package 比屋作业.day19;
import java.util.*;
public class D19_1 {
    public static void main(String[] args) {
        Map<String,String>phonBook=new HashMap<>();
        phonBook.put("张三","1234567890");
        phonBook.put("李四","9876543210");
        phonBook.put("王五","1357924680");
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入要查询的联系人的姓名：");
        String name=scanner.nextLine();
        String phonnumber=phonBook.get(name);
        if (phonnumber!=null){
            System.out.println(name+"的电话号码是："+phonnumber);
        }
        else {
            System.out.println("未找到"+name+"的电话号码！");
        }
        scanner.close();
    }

}
